﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MVCT7._1.Models;
namespace MVCT7._1.Controllers
{
    public class HomeController : Controller
    {

        public ActionResult Index()
        {
            return View();
        }
        [HttpPost]
            public ActionResult Index(string email)
        {
            using (fashionshoppingDBEntities db = new fashionshoppingDBEntities())
            {
                if (db.Users.Where(u => u.email == email).Count() > 0)
                {
                    return Content("false");//邮箱已存在
                }
                else
                {
                    return Content("true");//邮箱可以注册
                }
            }


        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
        //验证邮箱是否存在



    }
}